package output.html;

import java.util.ArrayList;

import utils.output.html.Header;
import utils.output.html.Link;
import utils.output.html.List;

import libutil.fileutil;
import libutil.filewriter;

public class Combat_index {

	private ArrayList<String> filenames;
	private fileutil util;

	public Combat_index(ArrayList<String> names, fileutil util){
		this.filenames = names;
		this.util = util;
	}
	
	public void write_html(){
		Link link = new Link();
		for(int i =0;i<this.filenames.size();i++){
			this.filenames.set(i, link.getlink_for_combat(this.filenames.get(i)));
		}
		filewriter writer = new filewriter(util.makepathforfile("index.html"));
		writer.insereligne("<!DOCTYPE html>");
		writer.insereligne("<html>");
		Header head = new Header();
		writer.insereligne(head.get_Html_begin());
		writer.insereligne("<body>");
		List list = new List(null);
		writer.insereligne(list.getList_for_arrayList(this.filenames));
		writer.insereligne("</body>");
		writer.insereligne("</html>");
		writer.close();
	}
}
